package com.zhang.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDate;
import java.util.List;

@Api(tags = "出库信息实体类")
@Data
@NoArgsConstructor
@TableName("t_outputinfo")
public class OutputInfoBean {

    @ApiModelProperty("出库信息id")
    @TableId(value = "pk_outputInfoId",type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("客户名")
    @TableField(value = "oi_name")
    private String name;

    @ApiModelProperty("销售员")
    @TableField(value = "oi_person")
    private String person;

    @ApiModelProperty("出库时间")
    @TableField(value = "oi_time")
    private LocalDate time = LocalDate.now();

    @ApiModelProperty("销售总金额")
    @TableField(value = "oi_total")
    private Integer total;

    @ApiModelProperty("送货地址")
    @TableField(value = "oi_address")
    private String address;

    @ApiModelProperty("订单集合")
    @TableField(exist = false)
    private List<OutputOrderBean> outputOrderBeans;

    public OutputInfoBean(String name, String person, int total, String address) {
        this.name = name;
        this.person = person;
        this.total = total;
        this.address = address;
    }

    @Override
    public String toString() {
        return "OutputInfoBean{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", person='" + person + '\'' +
                ", time='" + time + '\'' +
                ", total='" + total + '\'' +
                ", address='" + address + '\'' +
                ", outputOrderBeans=" + outputOrderBeans +
                '}' + "\n";
    }
}
